package com.wuhao.springbootactivemq.config;

import javax.jms.Queue;
import javax.jms.Topic;

import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.annotation.EnableJms;

/**
 * @author: wuhao
 * @since: 2021/11/7 17:08
 */
@Configuration
@EnableJms
public class ProjectConfig {

    @Value("${topic.name}")
    private String myTopic;

    @Bean
    public Topic topic(){

       return new ActiveMQTopic(myTopic);
    }
}
